<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
		<!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
		<meta name="renderer" content="webkit">
		<!--国产浏览器高速模式-->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="author" content="穷在闹市" />
		<!-- 作者 -->
		<meta name="revised" content="穷在闹市.v3, 2019/05/01" />
		<!-- 定义页面的最新版本 -->
		<meta name="description" content="网站简介" />
		<!-- 网站简介 -->
		<meta name="keywords" content="搜索关键字，以半角英文逗号隔开" />
		<title>穷在闹市出品</title>

		<!-- 公共样式 开始 -->
		<link rel="stylesheet" type="text/css" href="../../css/base.css">
		<link rel="stylesheet" type="text/css" href="../../css/iconfont.css">
		<script type="text/javascript" src="../../framework/jquery-1.11.3.min.js"></script>
		<link rel="stylesheet" type="text/css" href="../../layui/css/layui.css">
		<script type="text/javascript" src="../../layui/layui.js"></script>
		<!-- 滚动条插件 -->
		<link rel="stylesheet" type="text/css" href="../../css/jquery.mCustomScrollbar.css">
		<script src="../../framework/jquery-ui-1.10.4.min.js"></script>
		<script src="../../framework/jquery.mousewheel.min.js"></script>
		<script src="../../framework/jquery.mCustomScrollbar.min.js"></script>
		<script src="../../framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
		<!-- 公共样式 结束 -->
		

	</head>

	<body>
		<div class="cBody">
			<div class="console">
				<form class="layui-form" action="${pageContext.request.contextPath}/RoomAddressServlet" method="post">
					<div class="layui-form-item">
						<div class="layui-input-inline">
							<input type="text" name="name"  lay-verify="" placeholder="请输入订单编号" autocomplete="off" class="layui-input">
						</div>
						<input type ="submit" value="查询" class="layui-btn" lay-submit >
										
					</div>
				</form>

				<script>
					layui.use('form', function() {
						var form = layui.form;
				
						//监听提交
						form.on('submit(formDemo)', function(data) {
							layer.msg(JSON.stringify(data.field));
							return false;
						});
					});
				</script>
			</div>
			
			<table id="demo" class="layui-table">				
			</table>
			
			<!-- layUI 分页模块 -->
			<div id="pages"></div>
			<script>
			//修改按钮
			var updateFrame = null;
			
			layui.use(['laypage', 'layer','table'], function() {
				var layer = layui.layer;
				var laypage = layui.laypage;
				 var table = layui.table;
				  table.render({
					    elem: '#demo'
					    ,height: 312
					    ,url: '${pageContext.request.contextPath}/RoomAddressServlet' //数据接口
					    ,page: true //开启分页
					    ,cols: [[ //表头
					      {field: 'addressId', title: 'ID', width:80, sort: true, fixed: 'left'}
					      ,{field: 'addName', title: '用户名', width:80}
					      ,{field: 'addArea', title: '性别', width:80, sort: true}
					      ,{field: 'add', title: '城市', width:80} 
					      ,{field: 'phone', title: '签名', width: 177}
					      ,{field: 'defaultAdd', title: '积分', width: 80, sort: true}
					      ,{field: 'score', title: '评分', width: 80, sort: true}
					      ,{field: 'classify', title: '职业', width: 80}
					      ,{field: 'wealth', title: '财富', width: 135, sort: true}
					    ]]
					  });
				$("a[xiu]").click(function(){
					var nid=$(this).attr("xiu");
					updateFrame = layer.open({
                		title: "商品信息修改",
						type: 2,
						area: ['70%', '60%'],
						scrollbar: false,	//默认：true,默认允许浏览器滚动，如果设定scrollbar: false，则屏蔽
						maxmin: true,
						content: '${pageContext.request.contextPath}/RoomAddressServlet?action=update&nid='+nid											
					});
				});			
				//总页数大于页码总数
				laypage.render({
				    elem: 'pages'
				    ,count:3
				    ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
				    ,jump: function(obj){
				      console.log(obj)	
				    }
				});
				
			});


			</script>
		</div>
	</body>

</html>